package cn.iocoder.yudao.module.resource.api;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.resource.api.model.cosplayoperation.CosplayOperationDTO;
import cn.iocoder.yudao.module.resource.api.model.cosplayoperation.CosplayOperationPageReqDTO;
import cn.iocoder.yudao.module.resource.api.model.cosplayoperation.CosplayOperationSaveReqDTO;
import cn.iocoder.yudao.module.resource.controller.admin.cosplayoperation.CosplayOperationPageReqVO;
import cn.iocoder.yudao.module.resource.controller.admin.cosplayoperation.CosplayOperationSaveReqVO;
import cn.iocoder.yudao.module.resource.service.cosplayoperation.CosplayOperationService;
import org.springframework.stereotype.Service;

import jakarta.annotation.Resource;

@Service
public class CosplayOperationApiImpl implements ICosplayOperationApi {
    @Resource
    private CosplayOperationService cosplayOperationService;


    @Override
    public CosplayOperationDTO getCosplayOperationByRoleId(Long userId, Integer roleId) {
        return BeanUtils.toBean(cosplayOperationService.getCosplayOperationByRoleId(userId, roleId), CosplayOperationDTO.class);
    }

    @Override
    public PageResult<CosplayOperationDTO> getCosplayOperationPage(Long userId, CosplayOperationPageReqDTO pageReqVO) {
        return BeanUtils.toBean(cosplayOperationService.getCosplayOperationPage(userId, BeanUtils.toBean(pageReqVO, CosplayOperationPageReqVO.class)), CosplayOperationDTO.class);
    }

    @Override
    public void updateCosplayOperation(CosplayOperationSaveReqDTO updateReqVO) {
        cosplayOperationService.updateCosplayOperation(BeanUtils.toBean(updateReqVO, CosplayOperationSaveReqVO.class));
    }

    @Override
    public Long createCosplayOperation(CosplayOperationSaveReqDTO createReqVO) {
        return cosplayOperationService.createCosplayOperation(BeanUtils.toBean(createReqVO, CosplayOperationSaveReqVO.class));
    }
}
